import java.util.Scanner;

public class Factorial {
    public static void main(String[] args) {
        System.out.println("请输入要求的数的阶乘");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();

        System.out.println(num+"的阶乘为"+factorial(num));
    }
    public static int factorial(int num){
        return (num <= 1) ? 1 : num * factorial(num - 1);
    }
}